$(function(){
	var socketPath = window.location.host+"/park-web";
	 var webSocket;
    if ('WebSocket' in window) {
   	 webSocket = new WebSocket("ws://"+socketPath+"/ws");
    } else if ('MozWebSocket' in window) {
   	 webSocket = new MozWebSocket("ws://"+socketPath+"/ws");
    } else {
        //如果是低版本的浏览器，则用SockJS这个对象，对应了后台“sockjs/webSocketServer”这个注册器，
        //它就是用来兼容低版本浏览器的
   	 webSocket = new SockJS(window.location.origin+"/ws/sockjs");
    }
	webSocket.onopen = function(event){
	   // console.log("连接成功");
	};
	webSocket.onerror = function(event){
	    //console.log("连接失败");
	};
	webSocket.onclose = function(event){
	   // console.log("Socket连接断开");
	};
	webSocket.onmessage = function(event){
	    //接受来自服务器的消息
		 var data = JSON.parse(event.data);
		 console.info(data);
		   if(data.success){
			   
		   }else{
				showDiv();
				return;
		   }
	};
	//业务逻辑
	/*switch (businessType) {
	case value:
		
		break;

	default:
		break;
}*/
});